<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html lang="en" ng-app="myApp" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html lang="en">
    <!--<![endif]-->

    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>新建模板</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
        <link href="bower_components/angular-material/angular-material.css" rel="stylesheet"/>
        <!-- <link rel="stylesheet" href="styles/app2.css"> -->
        <link rel="stylesheet" href="styles/app3.css">

        <!-- <link rel="stylesheet" href="ruleModule/views/rules.css"> -->
        <link rel="stylesheet" href="rulesModule/views/rules.css">
        <link rel="stylesheet" href="uploadModule/views/upload.css">
        <link rel="stylesheet" href="testTextModule/views/testText.css">
        <link rel="stylesheet" href="templateModule/views/ruleGroup.css">
        <link rel="stylesheet" href="templateModule/views/tplGroup.css">
        <link rel="stylesheet" href="templateModule/views/showArticles.css">
        <link rel="stylesheet" href="templateModule/views/showTable.css">

        <base href="/">
    </head>

    <body ng-app="starterApp" layout="column" ng-controller="AppCtrl">

        <!-- Container #1 (see wireframe) -->
        <!-- Container #1 (see wireframe) -->
        <md-toolbar layout="row"  layout-align="center center" >
          <h2>Fbd-manage 模板管理</h2>
        </md-toolbar>

        <!-- Container #2 -->
        <div flex layout="row">
            <!-- Container #3 -->
            <!-- 左侧模板列表 -->
            <md-sidenav md-is-locked-open="true" class="md-whiteframe-z2">
              <md-list>
                <!-- List item #1 -->
                <md-list-item >
                    <md-button class="md-raised btn-new md-primary" ng-click="showNewTemplate($event)" flex="grow">++添加模板++ii</md-button>
                </md-list-item>
                <!-- List item #2 -->
                <md-list-item  ng-repeat="template in allTpls" ng-click="showDetailTemplate(template);mainTabIndex=1">
                    <md-button class="md-raised btn-new" ng-class="{true: 'md-primary', false: ' btn-deafult'}[tplSelected.name==template.name]" ng-click="showDetailTemplate(template)" flex="grow">{{template.name}}
                      <md-button class="del-temp" ng-click="deleteTemp(template._id)">×</md-button></md-button>
                </md-list-item>
              </md-list>
            </md-sidenav>

            <!-- 右侧内容 -->
            <md-content flex>
              <md-tabs md-dynamic-height md-border-bottom md-selected="mainTabIndex">
                <!-- {{fileName}} -->


                <!-- tab 0 -->
                <md-tab label="1.上传文件" ng-disabled="">
                <!-- <md-tab label="上传文件" ng-disabled="!step"> -->
                  <md-content class="md-padding" layout="column"  layout-align="">
                      <h3>上传文件</h3>
                    <!-- <h1 class="md-display-2" >上传文件</h1> -->
                      <!-- <upload-file file-name="fileName" real-file-name="realFileName"></upload-file> -->
                      <md-button ng-click="confirmFileUpload()" class=" md-cornered md-raised">点击上传文件</md-button>
                      <div ng-show="realFileName">
                        已经上传:{{realFileName}}
                      </div>


                  </md-content>
                </md-tab>

                <!-- tab 1 -->
                <md-tab label="2.模板配置">
                  <md-content class="md-padding">
                    <h3>模板配置</h3>
                    <md-list>
                      <md-subheader class="md-no-sticky">主模板规则</md-subheader>
                      <md-list-item>
                        <div layout="column">
                          <h4>{{currentTpl.content.name}}</h4>
                          <p>{{currentTpl.content.beginText}}</p>
                          <p>{{currentTpl.content.endText}}</p>
                          <md-input-container class="md-block">
                            <label>结束校验符</label>
                            <input name="end-sign" ng-model="currentTpl.content.validation" />
                          </md-input-container>
                          <md-input-container class="md-block">
                            <label>分栏线</label>
                            <input name="split-line" ng-model="currentTpl.content.splitLine" />
                          </md-input-container>
                        </div>
                      </md-list-item>

                      <!-- <md-divider></md-divider> -->
                      <md-subheader class="md-no-sticky">剔除规则</md-subheader>
                      <md-list-item>
                        <md-input-container class="md-block">
                          <label>选择已有模板</label>
                          <!-- {{selectedTpls}} -->
                          <md-select multiple ng-model="currentTpl.content.configs">
                            <md-option ng-repeat="tpl in allTpls" ng-value="tpl.content">{{tpl.name}}</md-option>
                          </md-select>
                        </md-input-container>

                      </md-list-item>
                      <md-list-item>
                        <tpl-group remove-tpls="currentTpl.content.configs"></tpl-group>
                      </md-list-item>
                    </md-list>
                    <!-- <h1 class="md-display-4">添加主规则</h1> -->
                    <div class="button-group" layout="row" layout-align="center">
                      <!-- <md-button class="md-raised" ng-click="mainTabIndex=2">下一步</md-button> -->
                      <md-button ng-click="saveTpl()" class="md-raised">保存</md-button>
                    </div>
                    <!-- {{currentTpl}} -->
                  </md-content>
                </md-tab>

                <!-- tab 2 -->
                <md-tab label="3.字段管理">
                  <md-content class="md-padding" layout="column">
                    <!-- <h1 class="md-display-4">管理字段</h1> -->
                    <h3>字段管理</h3>
                    <rule-group rules="currentTpl.content.subset" article-list="articleList" current-tpl="currentTpl" file-name="fileName"></rule-group>

                    <div class="button-group" layout="row" layout-align="center">
                      <!-- <md-button class="md-raised" ng-click="mainTabIndex=1">上一步</md-button> -->
                      <md-button class="md-raised" ng-click="testTemplate()">测试</md-button>
                      <md-button ng-click="saveTpl()" class="md-raised">保存</md-button>
                    </div>
                  </md-content>
                </md-tab>

                <!-- tab 3 -->
                <md-tab label="4.切割结果">
                  <md-content class="md-padding" layout="column">
                    <!-- <h1 class="md-display-4">切割结果</h1> -->
                    <h3>切割结果</h3>


                    <show-table show-result="showResult" flag="flag" subset-items="subsetItems"></show-table>

                    <div class="button-group" layout="row" layout-align="center">
                      <!-- <md-button class="md-raised" ng-click="mainTabIndex=2">上一步</md-button> -->
                      <md-button ng-click="saveTpl()" class="md-raised">保存</md-button>
                    </div>
                  </md-content>


                </md-tab>
              </md-tabs>
            </md-content>

            <!-- Container #4 -->
            <!-- <md-content flex id="content" layout-padding="" layout="row">
                <div flex layout-gt-sm="row" layout-sm="column">
                    <div flex-gt-sm="50" >center</div>
                    <div flex-gt-sm="50">
                      <rule-group></rule-group>

                    </div>
                </div>
            </md-content> -->



        </div>

        <script src="bower_components/jquery/dist/jquery.min.js"></script>
        <script src="bower_components/angular/angular.js"></script>
        <script src="bower_components/angular-route/angular-route.js"></script>
        <script src="bower_components/angular-mocks/angular-mocks.js"></script>
        <script src="bower_components/angular-bootstrap/ui-bootstrap.js"></script>
        <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
        <script src="bower_components/ng-file-upload/ng-file-upload.js"></script>
        <script src="bower_components/angular-sanitize/angular-sanitize.js"></script>

        <script src="bower_components/angular-animate/angular-animate.js" type="text/javascript"></script>
        <script src="bower_components/angular-aria/angular-aria.js" type="text/javascript"></script>
        <script src="bower_components/angular-material/angular-material.js" type="text/javascript"></script>
        <script src="bower_components/angular-material-icons/angular-material-icons.js" type="text/javascript"></script>

        <script src="app.js"></script>
        <!-- <script src="app2.js"></script> -->
        <script src="app3.js"></script>

        <!-- <script src="ruleModule/rule.module.js"></script> -->
        <script src="templateModule/template.module.js"></script>
        <script src="uploadModule/upload.module.js"></script>
        <script src="modalModule/modal.module.js"></script>
        <script src="testTextModule/testText.module.js"></script>
        <script src="auxModule/auxi.module.js"></script>

        <script src="rulesModule/rule.module.js"></script>
        <!-- <script src="controllers/e2emock.js"></script> -->

        <!-- controllers -->
        <!-- <script src="controllers/modalController.js"></script> -->
        <!-- <script src="templateModule/controllers/templateController.js"></script> -->
        <!-- <script src="ruleModule/controllers/ruleController.js"></script> -->
        <script src="uploadModule/controllers/uploadController.js"></script>
        <script src="templateModule/controllers/ruleGroupController.js"></script>
        <script src="testTextModule/controllers/textController.js"></script>

        <script src="rulesModule/controllers/ruleController.js"></script>
        <script src="templateModule/controllers/tplGroupController.js"></script>
        <script src="templateModule/controllers/showArticlesController.js"></script>
        <script src="templateModule/controllers/showTableController.js"></script>

        <!-- services -->
        <!-- <script src="modalModule/services/modalService.js"></script> -->
        <!-- <script src="ruleModule/services/ruleService.js"></script> -->
        <script src="auxModule/services/communicate.js"></script>
        <script src="auxModule/services/fbdService.js"></script>

        <!-- filters -->
        <script src="ruleModule/filters/ruleDataFilter.js"></script>
        <script src="ruleModule/filters/ruleFilter.js"></script>
        <!-- <script src="templateModule/filters/templateDataFilter.js"></script> -->
        <!-- <script src="templateModule/filters/showCurrentTemp.js"></script> -->
        <script src="templateModule/filters/testTemplateData.js"></script>
        <!-- <script src="auxModule/filters/enterFilter.js"></script> -->
        <script src="auxModule/filters/highlightFilter.js"></script>
        <script src="templateModule/filters/showTemplate.js"></script>
        <script src="auxModule/filters/ripTag.js"></script>
        <script src="auxModule/filters/ripContent.js"></script>
        <!-- <script src="templateModule/filters/showTemplateFilter.js"></script> -->

        <!-- directives -->
        <!-- <script src="auxModule/directives/compile.js"></script> -->
        <script src="templateModule/directives/ruleGroup.js"></script>
        <script src="uploadModule/directives/uploadFile.js"></script>
        <!-- <script src="ruleModule/directives/newRules.js"></script> -->
        <script src="testTextModule/directives/testText.js"></script>

        <script src="rulesModule/directives/addRules.js"></script>
        <script src="templateModule/directives/tplGroup.js"></script>
        <script src="templateModule/directives/showArticles.js"></script>
        <script src="templateModule/directives/showTable.js"></script>

    </body>
</html>
